package com.solo.system.dubbo;

import com.solo.system.api.SysDictApi;
import com.solo.system.api.entity.SysDictData;
import com.solo.system.mapper.SysDictDataMapper;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 字典实现类
 * @author 十一
 * @since 2023/12/08 14:17
 * 人生若只如初见，何事秋风悲画扇
 **/
@Service
@DubboService
@RequiredArgsConstructor
public class SysDictApiImpl implements SysDictApi {

    private final SysDictDataMapper sysDictDataMapper;

    /**
     * 根据编码获取字典数据列表
     * @param code 字典类型编码
     * @return 响应信息
     */
    public List<SysDictData> selectByCode(@PathVariable String code) {
        return sysDictDataMapper.selectByCode(code);
    }

}
